/**
 * 
 */
package niuke;

import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class 风狂序列 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		long n = new Scanner(System.in).nextLong();
		n = n << 1;
		// n=2000000000000000000L;
		System.out.println(getK(n));
	}

	private static long getK(long n) {
		long left = 1, right = (long) Math.sqrt(n)+1;
		while (left <= right) {
			long mid = left + ((right - left) / 2);
			if (mid * (mid + 1) >= n) {
				if (mid * (mid - 1) < n) {
					return mid;
				} else {
					right = mid - 1;
				}
			} else {
				left = mid + 1;

			}
		}
		return left;
	}

}
